{extends file = 'include/base_with_menu.tpl'}

{block name="javascript"}
<script type="text/javascript">
(function($)
{
    $(function()
    {
        $('#check_all').click(function()
        {
            if($(this).attr('checked'))
            {
                $('.cf_id').attr('checked', true);
            }
            else
            {
                $('.cf_id').attr('checked', false);
            }
        }
        );

        $('#back').click(function()
        {
            window.location = '/perm/class_func/role/list';
        }
        );
    }
    );
}
)(jQuery)
</script>
{/block}


{block name='content'}
<form id="role_set" method="post" action="/perm/class_func/role/set">
{foreach $class_func_dict as $catagory_id => $class_func_items}
<h3 class="blockTitle">{$catagory_dict[$catagory_id]}</h3>
<div class="layout">
    <table width="100%" class="tbLayout01" cellspacing="0" cellpadding="0">
        <tr>
            <td width="10" class="textRight">&nbsp;</td>
            <td width="200" class="textLeft">功能名</td>
            <td class="textLeft">功能描述</td>
        </tr>
    {foreach $class_func_items as $class_func}
        <tr>
        {if $class_func.r_id}
        {$checked_str='checked="checked"'}
        {else}
        {$checked_str=""}
        {/if}
            <td width="10" class="textRight">
                <input type="checkbox" class="cf_id" name="cf_id[]" value="{$class_func.id}" {$checked_str}  />
            </td>
            <td width="200" class="textLeft">{$class_func.name}</td>
            <td class="textLeft">{$class_func.description}</td>
        </tr>
    {/foreach}
    </table>
</div>
{/foreach}
{if $class_func_dict|count}
<div class="layout">
    <table width="100%" class="tbLayout01" cellspacing="0" cellpadding="0">
        <tr>
            <td width="10">
                <input type="checkbox" id="check_all" />
            </td>
            <td width="100" class="textLeft">
                <label for="check_all">全选/撤消</label>
            </td>
            <td class="textLeft">
                <input type="submit" value="提 交" />&nbsp;&nbsp;&nbsp;
                <input type="button" id="back" value="返 回" />
            </td>
        </tr>
    </table>
</div>
{/if}
<input type="hidden" name="role_id" value="{$role_id}" />
<input type="hidden" name="{$token_name}" value="{$token_hash}" />
</form>
{/block}
